package com.hdoit.ares.web.acc.modelconfig;

import com.hdoit.ares.web.acc.providers.GoldenBeanTypeProvider;
import com.hdoit.ares.web.acc.providers.StateProvider;
import com.tennetcn.common.enums.regular.MathRegularExpressions;
import com.tennetcn.component.attribute.DateTimeAttribute;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.RegularExpressionAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;

/**
 * @author      caochengmeng
 * @email       
 * @createtime  2017年11月29日 21:08:38
 * @comment
 */
public class GoldenBeanDetailConfig extends ModelMetadataAttributeConfiguration{
    public GoldenBeanDetailConfig(){
        this.setProperty("userIdentity")
            .hasAttribute(new DisplayNameAttribute("客户编号"));

        this.setProperty("customerName")
            .hasAttribute(new DisplayNameAttribute("客户名"));

        this.setProperty("goldenBeanType")
            .hasAttribute(new DisplayNameAttribute("交易类型"))
            .hasAttribute(new DropDownListAttribute(new GoldenBeanTypeProvider()));

        this.setProperty("time")
            .hasAttribute(new DisplayNameAttribute("交易时间"))
            .hasAttribute(new DateTimeAttribute());

        this.setProperty("outTradeNo")
            .hasAttribute(new DisplayNameAttribute("交易单号"));

        this.setProperty("state")
            .hasAttribute(new DisplayNameAttribute("收入/支出"))
            .hasAttribute(new DropDownListAttribute(new StateProvider()));

        this.setProperty("goldenBeanAccount")
            .hasAttribute(new DisplayNameAttribute("交易数目"));

        this.setProperty("goldenBeanBalance")
            .hasAttribute(new DisplayNameAttribute("剩余金豆"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.decimalTwo));

    }
}